infile = r'pre.fa'
filter_file = r'discard_miRNA_from_miRbase'

from Bio import SeqIO
outfile = 'remain_pre.fa'

delete_lista = []
with open(filter_file) as fila:
    for i in fila:
        k = i.split('\t')
        if len(k)>1:
            delete_lista.append(k[0])


with open(outfile,'w') as fila:
    for i in SeqIO.parse(infile,'fasta'):
        if i.name in delete_lista:
            print(i.name)
            pass
        else:
            fila.write('>'+str(i.name)+'\n')
            fila.write(str(i.seq)+'\n')



